import sys
from PySide import QtGui, QtCore


class Window(QtGui.QWidget):
    def __init__(self):
        super(Window, self).__init__()

        chkBox1 = QtGui.QCheckBox("Check Box 1", self)
        chkBox1.move(20, 20)
        chkBox1.toggle()
        chkBox1.stateChanged.connect(self.changeTheTitle) # Funny name, to differentiate from a default function

        chkBox2 = QtGui.QCheckBox("Check Box 2", self)
        chkBox2.move(20, 40)
        chkBox2.setDisabled(True)

        self.setGeometry(200, 200, 250, 200)
        self.setWindowTitle("Checkboxes")

    def changeTheTitle(self, state):
        if state == QtCore.Qt.Checked:
            self.setWindowTitle("Checkboxmann!!")
        else:
            self.setWindowTitle("Unchecked")

if __name__ == "__main__":
    appObject = QtGui.QApplication(sys.argv)
    ex = Window()
    ex.show()
    sys.exit(appObject.exec_())
